/**
 * routes是一个数组，数组中的每一个对象是一个路由对象，路由中常用的属性
 * path:路径:以/作为开头的
 * component:组件
 */
// import DiscoveryMusic from '@/views/DiscoveryMusic.vue'
// import MyMusic from '@/views/MyMusic.vue'
// import FriendMusic from '@/views/FriendMusic.vue'
// import Tuijian from '@/views/Tuijian.vue'
import Paihangbang from '@/views/Paihangbang.vue'
import GeDan from '@/views/GeDan.vue'
import ZhuBoDianTai from '@/views/ZhuBoDianTai.vue'
import GeShou from '@/views/GeShou.vue'
import XinDieShangJia from '@/views/XinDieShangJia.vue'
import CategoryArt from '@/views/CategoryArt.vue'
import TopListCategory from '@/views/TopListCategory.vue'
import NotFound from '@/views/NotFound.vue'

const routes=[
    {
        path:'*',
        component:()=>import('@/views/NotFound.vue')
    },
    {
        path:'',
        component:()=>import('@/views/DiscoveryMusic.vue'),
        children:[
            {
                path:'recomm',//嵌套路由如果不以/开头，它的path就是路由的path+自己路由的path
                component:()=>import('@/views/Tuijian.vue')
            },
            {
                path:'toplist',
                component:Paihangbang,
                children:[
                    {
                        name:'topListName',
                        path:'',//默认路由的配置
                        component:TopListCategory,
                        props(route){
                            return{
                                id:route.query.id
                            }
                        }
                    }
                ]
                
            },
            {
                path:'playlist',
                component:GeDan
            },
            {
                path:'djradio',
                component:ZhuBoDianTai
            },
            {
                path:'artist',
                component:GeShou,
                children:[
                    {
                        name:'CategoryArt',
                        path:'cat/:cid',
                        component:CategoryArt,
                        props:true
                    }
                ]
            },
            {
                path:'album',
                component:XinDieShangJia
            }
        ]
    },
    {
        path:'/my',
        redirect:'/me'//重定向
       
    },
    {
        path:'/me',
        component:()=>import('@/views/MyMusic.vue')

    },
    {
        path:'/friend',
        component:()=>import('@/views/FriendMusic.vue')
    }
]
export default routes